library("palmerpenguins")
library("ggplot2")
library("showtext")
library("marquee")
library("patchwork")
library("magick")Infographics
2024-11-19
Infographic are graphic visual representations of information, data, or knowledge intended to present information quickly and clearly
Infographics have evolved in recent years to be for mass communication
Are designed with fewer assumptions about the readers’ knowledge base than other types of visualizations
To whom are you communicating?
Different kinds of graphics will be needed depending on who your intended audience is
Consider the audience’s level of data / statistical sophistication
Lots of fonts that you can download for use in graphics
plt +
labs(
title = "Penguins, eh? Bigger than you thought!",
subtitle = "This scatterplot shows the relationship between the length of a penguin's flipper and it's body mass\nfor three different species of penguin; Adelie, Chinstrap, & Gentoo",
x = "Length of their bill in mm",
y = "Depth of their bill in mm"
)It would be nice if we could get rid of the legend
Colour the species name in the subtitle — marquee
With marquee, we specify the colour, say, using
But we want to mix plain text & coloured text, and perhaps use computed info — marquee_glue()
cols <- penguin_cols
names(cols) <- c("Adelie", "Chinstrap", "Gentoo")
st <- "This scatterplot shows the relationship between the length of a penguin's flipper and it's body mass\nfor three different species of penguin; {.{cols['Adelie']} Adelie}, {.{cols['Chinstrap']} Chinstrap}, & {.{cols['Gentoo']} Gentoo}"
mq_st <- marquee_glue(st)
plt +
labs(
title = "Penguins, eh? Bigger than you thought!",
subtitle = mq_st,
x = "Length of their flipper in mm",
y = "Body mass in grammes"
) +
theme(
legend.position = "none",
plot.subtitle = element_marquee(width = 1, family = "pacifico")
) -> final_plt
final_pltggplot2::annotate())